package com.yl.googleplayer_yl.adapter;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.ArrayList;

/**
 * Created by Administrator on 2016/11/1 0001.
 */

public class BasePagerAdapter extends PagerAdapter {
    protected ArrayList<String> picUrls;

    public BasePagerAdapter(ArrayList<String> picUrls) {
        this.picUrls = picUrls;
    }

    @Override

    public int getCount() {
        return picUrls.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view==object;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        return super.instantiateItem(container, position);
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView((View) object);
    }
}
